In [1]:
import StringIO
from qumulo.rest_client import RestClient
In [2]:
# login to the API
rc = RestClient("<qumulo-cluster>", 8000)
rc.login("<qumulo-user>", "<qumulo-password>");
In [3]:
file_meta = rc.fs.create_file(dir_path = "/", name="test-file.txt")
In [4]:
file_data = StringIO.StringIO()
file_data.write("Test " * 10)
file_meta = rc.fs.write_file(id_ = file_meta["id"], data_file = file_data)
file_data.close()
In [5]:
file_data = StringIO.StringIO()
rc.fs.read_file(id_ = file_meta["id"], file_ = file_data)
print(file_data.getvalue())
In [6]:
rc.fs.delete(id_ = file_meta["id"])
In [ ]: